//
//  Bridge.h
//  Charles
//
//  Created by Leo on 2019/6/21.
//  Copyright © 2019 charles. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/*
 类的功能层次结构:
 Ape
  |
  --Monkey
 */

@class ApeBehavior;

/**
 定义 "猿" 抽象类
 */
@interface Ape : NSObject

- (instancetype)initWithApeBehavior:(ApeBehavior *)behavior;

// 具备如下基本功能
- (void)walk;
- (void)eat;

@end

/**
 定义 "猴子" 具体类
 */
@interface Monkey : Ape

- (void)speak;

@end


/*
 类的实现层次结构:
 ApeBehavior
 |
 --MonkeyBehavior
 */

/**
 定义 "猿" 功能实现抽象类
 */
@interface ApeBehavior : NSObject

- (instancetype)initWithTitle:(NSString *)title;
- (void)apeWalk;
- (void)apeEat;

@end

/**
 定义 "猴子" 行为具体实现
 */
@interface MonkeyBehavior : ApeBehavior

- (void)apeWalk;
- (void)apeEat;

@end

NS_ASSUME_NONNULL_END
